<template>
	<view>
		<image :src="imgUrl" mode="widthFix" class="origin-img"></image>
		<view class="cloud-btn-group padding-10">
			<view class="btn" @click="downLoadImg">保存到相册</view>
			<view class="btn plain">
				<button class="share-btn" open-type="share">分享给好友</button>
			</view>
		</view>
		<video-a-d />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgUrl: "",
				name: ""
			};
		},
		onLoad(opts) {
      console.log(" --------  ",opts)
			this.imgUrl = opts.src
			this.name = opts.name || "趣味"
		},
		methods: {
			downLoadImg() {
				const vm = this
				uni.saveImageToPhotosAlbum({
					filePath: this.imgUrl,
					success() {
						vm.$util.showToast("保存成功")
					}
				})
			}
		},
		onShareAppMessage() {
			return {
				title: this.name,
        imageUrl: this.imgUrl,
        path:"/pages/result/result?src="+encodeURIComponent(this.imgUrl)
			}
		},
		onShareTimeline() {
			return {
				title: this.name,
        imageUrl: this.imgUrl,
        path:"/pages/result/result?src="+this.imgUrl
			}
		}
	}
</script>

<style lang="scss" scoped>
	.origin-img {
		width: 100%;
		min-height: 100px;
	}
</style>
